package com.zret.oasys.factory;

import com.zret.oasys.operation.dept.DeptServletOperation;

public class DeptServletFactory {
	
	// 返回值是operation继承的接口(为了多态)
	 public static DeptServletOperation getOpreation(String op)  {
		 String classStr = "com.zret.oasys.operation.dept." + op;
		 //System.out.println(classStr);
		 Class<?> cla;
		 Object obj = null;
		try {
			cla = Class.forName(classStr);
			obj = cla.newInstance();
		} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		 
		 return (DeptServletOperation) obj;
	 }
}
